Skip to content

feat: live colored compile log streaming in browser loading page - #154

Merged
zackees merged 1 commit into
mainfrom
feat/live-compile-log-streaming
Jun 11, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/live-compile-log-streaming

Conversation

@zackees

@zackees zackees commented Jun 11, 2026

Copy link
Copy Markdown
Member

Closes #153

Summary

  • Build subprocesses (meson, emcc/em++, emar) now run with piped stdout/stderr; every line is forwarded through a new LogSink to the terminal and the SSE /build-stream channel as it is produced — previously they inherited stdio and the browser only got a one-line summary after the build returned. PYTHONUNBUFFERED=1 keeps the Python-driven tools line-buffered. [WASM] progress markers go through the same sink.
  • Loading page log panel renders per-line <div>s (textContent — no HTML injection): warning: lines in yellow, error:/fatal error/undefined symbol/stderr-failure lines in red. Auto-scroll follows the tail unless the user scrolls up; on failure it jumps to the first diagnostic. The spinner remains the only activity indicator (no progress bar — step counts are unknowable).
  • Fatal-error handling: success is only published (SSE + build-status.json) when index.html actually exists on disk, so an error can never reload the page into a blank view; the SSE connection stays open after an error, and a later fixed rebuild recovers to the sketch in the same session.

Test plan

  • soldr cargo test --workspace — 136 tests pass (4 new: piped run_status streaming + failure, report_build_outcome index-gating, loading-page classification/no-progress-bar markers)
  • bash lint — fmt and clippy clean (dylint step fails identically on main: pre-existing dylint_driver build break, unrelated)
  • E2E with the release binary and a sketch containing an injected use of undeclared identifier error (fresh fastled_js/): 48 log lines streamed live over /build-stream during the build, compiler error line delivered with "stream":"stderr", build-status.json and SSE report error, / keeps serving the loading page (no index.html, no reload)
  • E2E recovery: removing the bad line triggered the watcher; SSE showed compiling → success, index.html was produced, and / served the real sketch — same CLI session, no restart

🤖 Generated with Claude Code

…ostics

Build subprocesses previously ran with inherited stdio, so the loading
page's SSE log panel only received a one-line summary after the build
finished. Spawn them with piped stdout/stderr instead, forwarding each
line through a LogSink to both the terminal and the SSE broadcast as it
is produced (PYTHONUNBUFFERED keeps the Python-driven tools line-buffered).

The loading page now renders per-line log entries with warnings in
yellow and errors in red, follows the tail unless the user scrolls up,
and jumps to the first diagnostic on failure. Success is only reported
when index.html actually exists on disk, so a fatal compile or link
error can never reload the page into a blank view; the SSE connection
stays open so a later fixed rebuild recovers in the same session.

Closes #153

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: live colored compile log streaming in browser loading page (spinner only, no progress bar)

1 participant